package com.gitee.xzb617.mybatis.query;

import com.gitee.xzb617.mybatis.query.condition.QueryCondition;

import java.util.List;
import java.util.Map;

/**
 * 动态表名查询
 * @author xuzhibin
 * @desc 可以根据输入的表名来动态查询数据，查询条件目前仅支持 =、日期查询
 */
public interface CommonQuery {

    public List<Map<String, Object>> select(String tableName);

    public <T> List<T> select(String tableName, Class<T> clazz);

    public Map<String, Object> selectOne(String tableName);

    public <T> T selectOne(String tableName, Class<T> clazz);

    public List<Map<String, Object>> select(String tableName, String[] columns);

    public <T> List<T> select(String tableName, String[] columns, Class<T> clazz);

    public Map<String, Object> selectOne(String tableName, String[] columns);

    public <T> T selectOne(String tableName, String[] columns, Class<T> clazz);

    public List<Map<String, Object>> select(String tableName, String[] columns, QueryCondition conditions);

    public <T> List<T> select(String tableName, String[] columns,QueryCondition conditions, Class<T> clazz);

    public Map<String, Object> selectOne(String tableName, String[] columns, QueryCondition conditions);

    public <T> T selectOne(String tableName, String[] columns, QueryCondition conditions, Class<T> clazz);
}
